{% extends "web/vipbase.html" %}

{% block rightcontent %}
<div class="order-main">
    <div class="type-tab-btn">
        <a href="javascript:;" class="allOrder active col-20" data-type="-1">全部订单</a><i class="line hidden-xs hidden-sm">|</i>
        <a class="waitPay col-20" href="javascript:;" data-type="0">待付款<span class="amount _actAmount"></span></a><i class="line hidden-xs hidden-sm">|</i>
        <a class="waitDeliver col-20" href="javascript:;" data-type="1">待发货</a><i class="line hidden-xs hidden-sm">|</i>
        <a class="hasDeliver col-20" href="javascript:;" data-type="2">已发货</a><i class="line hidden-xs hidden-sm">|</i>
        <a class="other col-20" href="javascript:;" data-type="99">其他</a>
    </div>
    <div class="list-head hidden-xs hidden-sm">
      <ul class="clearfix">
        <li class="w50">
            <select id="checkType" class="check-type">
                <option value="0">近三个月的订单</option>
                <option value="1">全部订单</option>
            </select>
            订单明细
        </li>
        <li class="w125">售后</li>
        <li class="w125">金额</li>
        <li class="w125">状态</li>
        <li class="w125">操作</li>
      </ul>
    </div>
    <div id="tableList" class="type-contain ui-load-container">

        <!-- 每个订单信息 -->
        {% for orders in orderslist %}
        <div class="ui-load-content" style="margin-top: 20px">
          <table class="orderItem">
            <tbody>
                <tr class="trHead hidden-xs hidden-sm">
                    <td colspan="4" class="title clearfix">
                      <div class="f-fl">
                          订单号：<span class="time">

                          {{ orders.id }}</span>
                          收货人：<span class="orderNumber">{{ orders.linkman }}</span>
                          收货地址：<span class="orderNumber">{{ orders.address }}</span>
                          联系电话：<span class="orderNumber">{{ orders.phone }}</span>
                      </div>
                    </td>
                </tr>
                <tr class="list-box b-l b-r b-b">
                    <td class="list b-r j-iamCart">
                        <div class="cart-wrap j-CartWrap">
                            <div class="shop j-shop j-amLight">
                                {% for detail in orders.detaillist %}
                                <div class="item b-t clearfix j-item j-iamMain" style="height:110px;">
                                    <a class="productDetail nameWidth col-xs-4 col-sm-4" href="{% url 'pdetail' detail.goodsid %}" target="_blank">
                                        <img src="/static/admin/upload/s_{{detail.picname}}" style="width:75px;height:75px" class="f-fl"/>
                                    </a>
                                    <div class="describe f-fl col-xs-8 col-sm-8">
                                        <div class="vertic clearfix">
                                            <span class="clearfix">
                                                <a class="productDetail nameWidth" href="#" target="_blank">
                                                <i>{{ detail.name }}</i></a>
                                                <p>
                                                ￥{{ detail.price}}×{{ detail.num}}
                                                </p>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                {% endfor %}
                            </div>
                        </div>
                    </td>
                    <td class="b-r w125 center price b-t hidden-xs hidden-sm">
                        <div class="priceDiv">
                            ￥ {{ orders.total }}  元
                        </div>
                    </td>
                    <td class="b-r w125 center state b-t hidden-xs hidden-sm">
                        <div class="stateDiv">
                               <div>
                                   {% if orders.state == 0 %}
                                    新订单 <br/><br/><br/>
                                    【<a href="{% url 'vip_orderstate' %}?oid={{orders.id}}&state=3">撤销订单</a>】
                                {% elif orders.state == 1 %}
                                    已发货 <br/><br/>
                                    【<a href="{% url 'vip_orderstate' %}?oid={{orders.id}}&state=2">确认收货</a>】
                                {% elif orders.state == 2 %}
                                    已完成
                                {% elif orders.state == 3 %}
                                    无效订单
                                {% else %}
                                    未知
                                {% endif %}
                               </div>
                        </div>
                    </td>
                    <td class="w125 center opreat b-t hidden-xs hidden-sm">
                        <ul>
                            <li class="more"><a href="#" target="_blank">查看详情</a></li>
                        </ul>
                    </td>
                </tr>
            </tbody>
          </table>
        </div>
        {% endfor %}
        <!-- 每个订单信息 end-->
    </div>
</div>
{% endblock %}